home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 6817 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.6 KB

  1. Path: news.u.washington.edu!lgy
  2. From: lgy@newton.phys.washington.edu (Laurence Yaffe)
  3. Newsgroups: gnu.g++.help,comp.lang.c++,comp.sys.sgi.apps,comp.sys.sgi.misc
  4. Subject: Re: SGI and C++
  5. Date: 19 Feb 1996 23:58:40 GMT
  6. Organization: University of Washington
  7. Message-ID: <4gb2rg$b99@nntp1.u.washington.edu>
  8. References: <4f609s$rho@fu-berlin.de> <4f6726$4ch@fido.asd.sgi.com> <4fahih$s13@fu-berlin.de> <4fbhs0$eo3@fido.asd.sgi.com> <4fl2nh$b66@sun20.ccd.bnl.gov> <4ga186$bk2@oban.cc.ic.ac.uk> <4gar2s$905@fido.asd.sgi.com>
  9. NNTP-Posting-Host: newton.phys.washington.edu
  10. X-Newsreader: NN version 6.5.0 #2 (NOV)
  11.  
  12. shankar@mti.sgi.com (Shankar Unni) writes:
  13.  
  14. >There *is* a known bug that I found recently (for which there won't be a fix
  15. >in Irix 6.2, since we found the problem too late to get into that release - it
  16. >will be fixed in a patch), where if you declare a template member function
  17. >in the following way, it's NOT inlined:
  18.  
  19. >  template <class T> class Foo {
  20. >      ...
  21. >      void memfunc();    /* no inline specification here */
  22. >      ...
  23. >  };
  24.  
  25. >  template <class T> inline Foo<T>::memfunc()
  26. >  {
  27. >    /* defined as inline, but compiler will fail to inline it */
  28. >  }
  29.  
  30.  
  31. >The workaround for this problem is to stick the inline keyword before the
  32. >declaration of the member function inside the template class.
  33.  
  34. Is there any similar problem with inlining non-member template functions?
  35. What is the easiest way to tell if a function actually did get inlined?
  36.  
  37. ------------------------------------------------------------------------
  38. Laurence G. Yaffe        lgy@phys.washington.edu
  39. University of Washington    1-206-543-3902 (fax: 1-206-543-9523)
  40.